<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Grid布局</title>
    <style>
        .layout {
            display: grid;
            grid-template-columns: repeat(4, calc(25%-5px));
            grid-template-rows: repeat(4, 100px);
            grid-auto-rows: min-content;
            grid-gap: 10px;
            background: #555;
            padding: 10px;
            box-sizing: border-box;
        }
        .item{
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 30px;
            color: #fff;
        }
        .item-a {
            grid-row: 1/span 2;
            grid-column: 1/3;
            background: #F9CA00;
        }

        .item-b {
            grid-row: 1 /span 1;
            grid-column: 3/5;
            background: #FF84C2;
        }

        .item-c {
            grid-row: 2 / span 1;
            grid-column: 3 / 4;
            background: #1AAD19;
        }

        .item-d {
            grid-row: 2 / span 3;
            grid-column: 4 / 5;
            background: #EC6149;
        }

        .item-e {
            grid-row: 3 /span 2;
            grid-column: 1 /2;
            background: #63B0EB;
        }

        .item-f {
            grid-row: 3 /span 2;
            grid-column: 2 / 4;
            background: #8085E9;
        }
    </style>
</head>

<body>
    <div class="layout">
        <div class="item item-a">1</div>
        <div class="item item-b">2</div>
        <div class="item item-c">3</div>
        <div class="item item-d">4</div>
        <div class="item item-e">5</div>
        <div class="item item-f">6</div>
    </div>
</body>

</html>